#region Copyright RenGuiYou. All rights reserved.

//=====================================================
// PandoraFrameWork
// Author:      RenGuiyou
// Feedback: 	mailto:750539605@qq.com
//=====================================================

#endregion

using UnityEngine;

namespace Pandora.Console
{
    public class GraphicsInfoWindow : ScrollWindowBase
    {
        protected override void OnDrawScrollableWindow()
        {
            GUILayout.Label("<b>显卡信息</b>");
            GUILayout.BeginVertical("box");
            {
                DrawItem("显卡ID:", SystemInfo.graphicsDeviceID.ToString());
                DrawItem("显卡名称:", SystemInfo.graphicsDeviceName);
                DrawItem("显卡供应唯一ID:", SystemInfo.graphicsDeviceVendorID.ToString());
                DrawItem("显卡供应商:", SystemInfo.graphicsDeviceVendor);
                DrawItem("显卡型号:", SystemInfo.graphicsDeviceType.ToString());
                DrawItem("显卡版本号:", SystemInfo.graphicsDeviceVersion);
                DrawItem("显存大小:", string.Format("{0} MB", SystemInfo.graphicsMemorySize.ToString()));
                DrawItem("支持多线程渲染:", SystemInfo.graphicsMultiThreaded.ToString());
                DrawItem("支持Shader级别:", GetShaderLevelString(SystemInfo.graphicsShaderLevel));
                DrawItem("NPOT支持:", SystemInfo.npotSupport.ToString());
                DrawItem("最大贴图大小:", SystemInfo.maxTextureSize.ToString());
                DrawItem("支持复制贴图:", SystemInfo.copyTextureSupport.ToString());
                DrawItem("支持渲染目标数量:", SystemInfo.supportedRenderTargetCount.ToString());
                DrawItem("支持稀疏纹理:", SystemInfo.supportsSparseTextures.ToString());
                DrawItem("支持3D贴图:", SystemInfo.supports3DTextures.ToString());
                DrawItem("支持2D贴图组:", SystemInfo.supports2DArrayTextures.ToString());
                DrawItem("支持阴影:", SystemInfo.supportsShadows.ToString());
                DrawItem("支持阴影深度:", SystemInfo.supportsRawShadowDepthSampling.ToString());
                DrawItem("支持渲染到立方图:", SystemInfo.supportsRenderToCubemap.ToString());
                DrawItem("支持电脑着色:", SystemInfo.supportsComputeShaders.ToString());
                DrawItem("支持实例:", SystemInfo.supportsInstancing.ToString());
                DrawItem("支持离屏特效:", SystemInfo.supportsImageEffects.ToString());
                DrawItem("支持运动向量:", SystemInfo.supportsMotionVectors.ToString());
//                    DrawItem("支持立方图贴图组:", SystemInfo.supportsCubemapArrayTextures.ToString());
//                    DrawItem("支持逆转深度缓冲(ZBuff):", SystemInfo.usesReversedZBuffer.ToString());
            }
            GUILayout.EndVertical();
        }

        private string GetShaderLevelString(int shaderLevel)
        {
            return string.Format("Shader Model {0}.{1}", (shaderLevel / 10).ToString(), (shaderLevel % 10).ToString());
        }
    }
}